<template>
	<div class="attribute">
		<component :is="type + 'Attribute'" :attributeInfo="currentData"></component>
	</div>
</template>
 
<script>
import { mapGetters } from 'vuex';
import ModelAttribute from '@/components/attribute/model';
import PointAttribute from '@/components/attribute/point';

export default {
	name: 'Attribute',
	components: {
		ModelAttribute /* 模型属性 */,
		PointAttribute /* 点属性 */
	},
	data() {
		return {
			type: 'Model' /* 属性类型 */
		};
	},
	computed: {
		...mapGetters('ue4Info', {
			currentData: 'queryCurrentActorData'
		})
	},
	watch: {
		currentData(val) {
			if (val.ClassName === 'Point') {
				this.type = 'Point';
			} else if (val.ClassName === 'Mesh') {
				this.type = 'Model';
			}
		}
	},
	created() {
		this.init();
	},
	methods: {
		// 初始化
		init() {}
	}
};
</script>
 
<style lang="scss">
.attribute {
	font-size: 12px;
	padding: 0 15px;
	height: 100%;
	overflow-y: auto;
	@include xy-scroll;
	background-color: transparent;
	color: $--xy-color-light;
}
</style>